package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.heima.pojo.dto.PageDTO;
import com.heima.pojo.entity.Region;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * \* User: chy
 * \* Date: 2025/8/17   13:27
 * \* Description:
 * \
 */
@Mapper
public interface RegionMapper extends BaseMapper<Region> {

    /*
    * 查询区域列表
    * */
    Page<Region> page(PageDTO pageDTO);

    @Insert("insert into tb_region (name, remark) value (#{name},#{remark})")
    void add(Region region);

    /*
    * 修改区域
    * */

    /*
    * 删除区域数据
    * */
    @Delete("delete from tb_region where id = #{id}")
    void deletById(String id);

    /*
    * 根据ids集合查询所有Region
    * */
    List<Region> getByids(List<String> regionIds);
}
